Noro's TrendMA StrategyThe strategy uses 2 moving averages. Fast and slow. SMA or EMA - the user can select. Moving averages are needed to identify the direction of the trend.
Trend
If both moving averages are directed upwards, it 's uptrend.
If both moving averages are pointing down, it 's downtrend.
If the moving averages are directed in different directions, the trend has not changed.
Background
Lime color is uptrend.
Red color is downtrend.
By default, background display is disabled, but you can enable it in script settings.
Trading
If uptrend (lime background) - open long position (and close short position)
If downtrend (red background) - open short position (and close long position)
Reverse trading, no stop-loss and take-profit
Short positions can be removed and only long positions can be traded.
For
- crypto/USD (XBT/USD, ETH/USD, etc)
- timeframes: 1h, 4h, 1d
ค้นหาในสคริปต์สำหรับ "the strat"
Hucklekiwi Pip - HLHB Trend-Catcher SystemThe strategy was authored by Hucklekiwi Pip back in 2015 and is still being updated today. She says that the system was designed to simply catch short-term forex trends. At its heart, the system is a simple EMA crossover strategy with a couple of other indicators used for confirming entries.
Strategy Rules
See her original post here:
www.babypips.com
Be sure to check out the updates and tweaks over the years!
HOW TO USE
For full information on how to use this strategy and how to correctly set the exit time, see this post:
backtest-rookies.com
Febres StrategyThe strategy consist in every time that price failed to break any of the EMAs, we need to wait for the right price action and make a buy or sell when it bounce from it to keep surfing on the trend (using the stochastic oscillator and the 5-13 EMAs cross as an additional confirmation).
When do we start looking for a change on the trend? When it repeats the blue tracer (high or low of the previous day) without breaking it and bouncing from it, there will be our signal to start looking for a change of direction on the trend.
Only applicable on 15 minute chart.
Sb_Rate_Of_Change_BB_Band_strategy Version 1.0The strategy couples the concept of rate of change along with the Bollinger bands.
Along with it LazyBear's RSI/MFI with Volatility Indicator is also taken to reduce the number of trades and improve efficiency.
Strategy (in Layman terms):
If in the past 10 candles RSI/MFI with Volatility Indicator has printed a red/green colour and the roc has gone above/below the Bollinger bands then the short/long order is placed respectively.
Message if you think of any modifications/ enhancements/ any opportunities. :)
Donations/Tips... :) -
BTC: 1BjswGcRR6c23pka7qh5t5k56j46cuyyy2
ETH: 0x64fed71c9d6c931639c7ba4671aeb6b05e6b3781
LTC: LKT2ykQ8QSzzfTDB6Tnsf12xwYPjgq95h4
SB_Compliment_RSI StrategyThe strategy modifies the original rsi strategy with the addition of compliment si (i.e. 100-rsi).
Strategy Idea: Previous rsi high and low value is recorded when the rsi crosses overBought(70) and OverSold(30) values.
Now when the rsi crosses above the overSold range, the rsi is matched with the compliment of previous high rsi value. If the compliment i.e.(100-prev_rsi_high) is less than or equal to rsi then long position is taken.
For short position, when the rsi crosses below the overBought range, the rsi is matched with the compliment of previous low rsi value. If compliment i.e.(100-prev_rsi_low) is greater than or equal to rsi.
Below s the code for the indicator present in the chart.
//@version=3
study(title="SB_Compliment_Relative Strength Index", shorttitle="RSI")
src = close, len = input(14, minval=1, title="Length")
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
plot(rsi, color=purple)
plot(100-rsi, color=orange)
band1 = hline(70)
band0 = hline(30)
fill(band1, band0, color=purple, transp=90)
The code also has switch code also which means it will enter the overBrought or overSold block one after the other.
Future modifications: Currently the value of rsi tracked is the one in which it crosses the overSold or OverBought range and not the highest/lowest value when the value is above/below OverBought/OverSold range.
Comment the perfect combination of indicators for it and will try to incorporate those indicators into it in the next version.
Message if you think of any modifications/ enhancements/ any opportunities. :)
Donations/Tips... :) -
BTC: 1BjswGcRR6c23pka7qh5t5k56j46cuyyy2
ETH: 0x64fed71c9d6c931639c7ba4671aeb6b05e6b3781
LTC: LKT2ykQ8QSzzfTDB6Tnsf12xwYPjgq95h4
SB_Elder Impulse SystemThe strategy is based on LazyBear's Elder Impulse System
Strategy(in layman terms):
Long: When the green bar in the Elder Impulse System's indicator shows up
Short: When the red bar in the Elder Impulse System's indicator shows up
Close trade/Profit booking: When the blue bar in the Elder Impulse System's indicator shows up
Original Idea:
Message in the script if you think of any modifications/ enhancements.
Donations/Tips... :) -
BTC: 1BjswGcRR6c23pka7qh5t5k56j46cuyyy2
ETH: 0x64fed71c9d6c931639c7ba4671aeb6b05e6b3781
LTC: LKT2ykQ8QSzzfTDB6Tnsf12xwYPjgq95h4
Rainbow StrategyThe strategy is based on the following idea:
www.youtube.com
Not a fan of this but no script was present to show this idea's performance.
Best suitable for the 1-minute chart. You can change the ema values as per your needs.
For Tips to continue :) -
BTC: 1BjswGcRR6c23pka7qh5t5k56j46cuyyy2
ETH: 0x64fed71c9d6c931639c7ba4671aeb6b05e6b3781
LTC: LKT2ykQ8QSzzfTDB6Tnsf12xwYPjgq95h4
SB_CM_RSI_2_Strategy_Version 1.0The strategy is based on the indicator posted by @ChrisMoody "CM RSI-2 Strategy Lower Indicator" which is based on "Larry Connors RSI-2 Strategy - Lower RSI"
In this strategy the longs are placed when a green color is encountered in the rsi and short when red color is encountered in the rsi.
Although the profits can be booked at different interval.
Just message in the script if you have any different idea regarding this indicator.
For the original indicator you can refer to :
For Tips to continue :) :
BTC: 1BjswGcRR6c23pka7qh5t5k56j46cuyyy2
ETH: 0x64fed71c9d6c931639c7ba4671aeb6b05e6b3781
LTC: LKT2ykQ8QSzzfTDB6Tnsf12xwYPjgq95h4
Free Strategy #01 (ES / SPY)The strategy was designed to be traded based on daily data on the ES and SPY--the strategy was originally developed on NinjaTrader using approximately 50% out of sample data with a slippage of 1 tick on the ES. This is our first strategy that we converted from NinjaTrader to TradingView, so if you see any issues with our conversion, please let us know as we are still learning TradingView Pine Script.
Alerts v6The strategy includes:
✅ EMA-based trend direction (fast vs slow)
✅ RSI filtering for overbought/oversold control
✅ ADX confirmation for strong trend validation
✅ Pullback & BOS detection for precision entries
✅ Per-bar change logic for adaptive entry timing
✅ Session/day gating to control trading hours
✅ JSON alert integration for AI trading bots or webhooks
This script is Pine Script v6 compatible and optimized for automated alert-based trading setups such as AI trading bots, webhook systems, and VPS-linked executions.
Recommended Timeframes: 5m, 15m, 30m
Markets: XAUUSD, FX pairs, indices, and metals
CE+ZLSMA RovTrading StrateryThe strategy is optimized for scalping in small timeframes like M15 and M30, as well as M5.
It combines two indicators: CE and ZLSMA.
Try it now!
dabilThe strategy is probably to go short or long with the trend depending on the case, but if all time units 1 minute then 3 minutes then 5 minutes then 15 minutes then 1 hour all show the same direction, but first the 1 hour must be bullish in which the 1 hour candle closes above the previous one, for example if the trend is bearish then the market wants to change direction, then a 1 hour bullish close must then be followed by a 1 hour bearish close below the bullish candle, then another bullish candle must shoot above the previous bullish candle, then 15 minutes also shoot above the previous 15 bullish candles, then 1 and 2...3.5. Then I can rise with the market by only covering the last 15 bullish candles with my stop loss, if my SL is 50 pips then I want 100 pips and then I'm out.
I11L Long Put/Call Ratio InversionThe Strategy uses the Put/Call Options Ratio Inversaion as a Signal and Implements simple Money Management rules.
It is adjusted for the NDX and for the SPX in the 30min Range.
The Oscilation has to be finetuned to reflect the correct Reversal point.
A good indicator of the correct Reversal Point is a solid range of good backtesting results..
The strategy example. Close position by timeoutThis is an example how to close open entries by timeout for educational purpose.
Trend Following or Mean RevertingThe strategy checks nature of the instruments. It Buys if the close is greater than yesterday's high, reverse the position if the close is lower than yesterday's low and repeat the process.
1. If it is trend following then the equity curve will be in uptrend
2. If it is mean reverting then the equity curve will be downtrend
Thanks to Rayner Teo.
Bollinger and Tendencies (Bollinger e Tendências )The strategy consists of buying when the price breaks up (crossover) the bottom line of the Bollinger and selling when the price breaks down (crossunder) to your top line.
The chart still shows trends clearly, with the fill between the exponential average and the closing value of the canlestick, green at high, red at low (this part of the script is based on the code: "Pivot Daily Price Color" by Rimko).
It also places notes on the high and low candlesticks (based on the code: "Candlesticks Pattern Identified" by Repo32).
It is recommended to use it in conjunction with the "IFR and Storage" script (also available to me), and some volume script.
A estratégia consiste em comprar quando o preço rompe para cima (crossover) a linha inferior do Bollinger e vender quando o preço rompe para baixo (crossunder) a sua linha superior.
O gráfico ainda mostra as tendências de forma clara, com o preenchimento entre a média exponencial e o valor de fechamento do canlestick, verde em alta, vermelho em baixa (essa parte do script é baseada no código: "Pivot Daily Price Color" do usuário: Rimko).
Também, coloca apontamentos nos candlesticks de alta e de baixa (baseado no código: "Candlesticks Pattern Identified" do usuário Repo32).
Recomenda-se a utilização em conjunto com o script "IFR e Estocagem" (também por mim disponibilizado), e algum script de volume.
SB_Volume_oscillator_Prev_high_lowThe strategy is a take on traditional volume oscillator.
In Layman terms:
The script places an order when the oscillator crosses the zero mark in the volume oscillator.
If the previous high is greater than the absolute value of previous low then a long order is placed
And if the absolute previous low is greater than the previous high then a shrt order is placed.
Last script (bandwidth focus on other monetary works. If you have any opportunities ping me)
Message if you think of any modifications/ enhancements/ any opportunities. :)
Donations/Tips... :) -
BTC: 1BjswGcRR6c23pka7qh5t5k56j46cuyyy2
ETH: 0x64fed71c9d6c931639c7ba4671aeb6b05e6b3781
LTC: LKT2ykQ8QSzzfTDB6Tnsf12xwYPjgq95h4
TRADINGLibrary "TRADING"
This library is a client script for making a webhook signal formatted string to PoABOT server.
entry_message(password, percent, leverage, margin_mode, kis_number)
Create a entry message for POABOT
Parameters:
password (string) : (string) The password of your bot.
percent (float) : (float) The percent for entry based on your wallet balance.
leverage (int) : (int) The leverage of entry. If not set, your levereage doesn't change.
margin_mode (string) : (string) The margin mode for trade(only for OKX). "cross" or "isolated"
kis_number (int) : (int) The number of koreainvestment account. Default 1
Returns: (string) A json formatted string for webhook message.
order_message(password, percent, leverage, margin_mode, kis_number)
Create a order message for POABOT
Parameters:
password (string) : (string) The password of your bot.
percent (float) : (float) The percent for entry based on your wallet balance.
leverage (int) : (int) The leverage of entry. If not set, your levereage doesn't change.
margin_mode (string) : (string) The margin mode for trade(only for OKX). "cross" or "isolated"
kis_number (int) : (int) The number of koreainvestment account. Default 1
Returns: (string) A json formatted string for webhook message.
close_message(password, percent, margin_mode, kis_number)
Create a close message for POABOT
Parameters:
password (string) : (string) The password of your bot.
percent (float) : (float) The percent for close based on your wallet balance.
margin_mode (string) : (string) The margin mode for trade(only for OKX). "cross" or "isolated"
kis_number (int) : (int) The number of koreainvestment account. Default 1
Returns: (string) A json formatted string for webhook message.
exit_message(password, percent, margin_mode, kis_number)
Create a exit message for POABOT
Parameters:
password (string) : (string) The password of your bot.
percent (float) : (float) The percent for exit based on your wallet balance.
margin_mode (string) : (string) The margin mode for trade(only for OKX). "cross" or "isolated"
kis_number (int) : (int) The number of koreainvestment account. Default 1
Returns: (string) A json formatted string for webhook message.
manual_message(password, exchange, base, quote, side, qty, price, percent, leverage, margin_mode, kis_number, order_name)
Create a manual message for POABOT
Parameters:
password (string) : (string) The password of your bot.
exchange (string) : (string) The exchange
base (string) : (string) The base
quote (string) : (string) The quote of order message
side (string) : (string) The side of order messsage
qty (float) : (float) The qty of order message
price (float) : (float) The price of order message
percent (float) : (float) The percent for order based on your wallet balance.
leverage (int) : (int) The leverage of entry. If not set, your levereage doesn't change.
margin_mode (string) : (string) The margin mode for trade(only for OKX). "cross" or "isolated"
kis_number (int) : (int) The number of koreainvestment account.
order_name (string) : (string) The name of order message
Returns: (string) A json formatted string for webhook message.
in_trade(start_time, end_time, hide_trade_line)
Create a trade start line
Parameters:
start_time (int) : (int) The start of time.
end_time (int) : (int) The end of time.
hide_trade_line (bool) : (bool) if true, hide trade line. Default false.
Returns: (bool) Get bool for trade based on time range.
real_qty(qty, precision, leverage, contract_size, default_qty_type, default_qty_value)
Get exchange specific real qty
Parameters:
qty (float) : (float) qty
precision (float) : (float) precision
leverage (int) : (int) leverage
contract_size (float) : (float) contract_size
default_qty_type (string)
default_qty_value (float)
Returns: (float) exchange specific qty.
method set(this, password, start_time, end_time, leverage, initial_capital, default_qty_type, default_qty_value, margin_mode, contract_size, kis_number, entry_percent, close_percent, exit_percent, fixed_qty, fixed_cash, real, auto_alert_message, hide_trade_line)
Set bot object.
Namespace types: bot
Parameters:
this (bot)
password (string) : (string) password for poabot.
start_time (int) : (int) start_time timestamp.
end_time (int) : (int) end_time timestamp.
leverage (int) : (int) leverage.
initial_capital (float)
default_qty_type (string)
default_qty_value (float)
margin_mode (string) : (string) The margin mode for trade(only for OKX). "cross" or "isolated"
contract_size (float)
kis_number (int) : (int) kis_number for poabot.
entry_percent (float) : (float) entry_percent for poabot.
close_percent (float) : (float) close_percent for poabot.
exit_percent (float) : (float) exit_percent for poabot.
fixed_qty (float) : (float) fixed qty.
fixed_cash (float) : (float) fixed cash.
real (bool) : (bool) convert qty for exchange specific.
auto_alert_message (bool) : (bool) convert alert_message for exchange specific.
hide_trade_line (bool) : (bool) if true, Hide trade line. Default false.
Returns: (void)
method print(this, message)
Print message using log table.
Namespace types: bot
Parameters:
this (bot)
message (string)
Returns: (void)
method start_trade(this)
start trade using start_time and end_time
Namespace types: bot
Parameters:
this (bot)
Returns: (void)
method entry(this, id, direction, qty, limit, stop, oca_name, oca_type, comment, alert_message, when)
It is a command to enter market position. If an order with the same ID is already pending, it is possible to modify the order. If there is no order with the specified ID, a new order is placed. To deactivate an entry order, the command strategy.cancel or strategy.cancel_all should be used. In comparison to the function strategy.order, the function strategy.entry is affected by pyramiding and it can reverse market position correctly. If both 'limit' and 'stop' parameters are 'NaN', the order type is market order.
Namespace types: bot
Parameters:
this (bot)
id (string) : (string) A required parameter. The order identifier. It is possible to cancel or modify an order by referencing its identifier.
direction (string) : (string) A required parameter. Market position direction: 'strategy.long' is for long, 'strategy.short' is for short.
qty (float) : (float) An optional parameter. Number of contracts/shares/lots/units to trade. The default value is 'NaN'.
limit (float) : (float) An optional parameter. Limit price of the order. If it is specified, the order type is either 'limit', or 'stop-limit'. 'NaN' should be specified for any other order type.
stop (float) : (float) An optional parameter. Stop price of the order. If it is specified, the order type is either 'stop', or 'stop-limit'. 'NaN' should be specified for any other order type.
oca_name (string) : (string) An optional parameter. Name of the OCA group the order belongs to. If the order should not belong to any particular OCA group, there should be an empty string.
oca_type (string) : (string) An optional parameter. Type of the OCA group. The allowed values are: "strategy.oca.none" - the order should not belong to any particular OCA group; "strategy.oca.cancel" - the order should belong to an OCA group, where as soon as an order is filled, all other orders of the same group are cancelled; "strategy.oca.reduce" - the order should belong to an OCA group, where if X number of contracts of an order is filled, number of contracts for each other order of the same OCA group is decreased by X.
comment (string) : (string) An optional parameter. Additional notes on the order.
alert_message (string) : (string) An optional parameter which replaces the {{strategy.order.alert_message}} placeholder when it is used in the "Create Alert" dialog box's "Message" field.
when (bool) : (bool) An optional parmeter. Condition, deprecated.
Returns: (void)
method order(this, id, direction, qty, limit, stop, oca_name, oca_type, comment, alert_message, when)
It is a command to place order. If an order with the same ID is already pending, it is possible to modify the order. If there is no order with the specified ID, a new order is placed. To deactivate order, the command strategy.cancel or strategy.cancel_all should be used. In comparison to the function strategy.entry, the function strategy.order is not affected by pyramiding. If both 'limit' and 'stop' parameters are 'NaN', the order type is market order.
Namespace types: bot
Parameters:
this (bot)
id (string) : (string) A required parameter. The order identifier. It is possible to cancel or modify an order by referencing its identifier.
direction (string) : (string) A required parameter. Market position direction: 'strategy.long' is for long, 'strategy.short' is for short.
qty (float) : (float) An optional parameter. Number of contracts/shares/lots/units to trade. The default value is 'NaN'.
limit (float) : (float) An optional parameter. Limit price of the order. If it is specified, the order type is either 'limit', or 'stop-limit'. 'NaN' should be specified for any other order type.
stop (float) : (float) An optional parameter. Stop price of the order. If it is specified, the order type is either 'stop', or 'stop-limit'. 'NaN' should be specified for any other order type.
oca_name (string) : (string) An optional parameter. Name of the OCA group the order belongs to. If the order should not belong to any particular OCA group, there should be an empty string.
oca_type (string) : (string) An optional parameter. Type of the OCA group. The allowed values are: "strategy.oca.none" - the order should not belong to any particular OCA group; "strategy.oca.cancel" - the order should belong to an OCA group, where as soon as an order is filled, all other orders of the same group are cancelled; "strategy.oca.reduce" - the order should belong to an OCA group, where if X number of contracts of an order is filled, number of contracts for each other order of the same OCA group is decreased by X.
comment (string) : (string) An optional parameter. Additional notes on the order.
alert_message (string) : (string) An optional parameter which replaces the {{strategy.order.alert_message}} placeholder when it is used in the "Create Alert" dialog box's "Message" field.
when (bool) : (bool) An optional parmeter. Condition, deprecated.
Returns: (void)
method close_all(this, comment, alert_message, immediately, when)
Exits the current market position, making it flat.
Namespace types: bot
Parameters:
this (bot)
comment (string) : (string) An optional parameter. Additional notes on the order.
alert_message (string) : (string) An optional parameter which replaces the {{strategy.order.alert_message}} placeholder when it is used in the "Create Alert" dialog box's "Message" field.
immediately (bool) : (bool) An optional parameter. If true, the closing order will be executed on the tick where it has been placed, ignoring the strategy parameters that restrict the order execution to the open of the next bar. The default is false.
when (bool) : (bool) An optional parmeter. Condition, deprecated.
Returns: (void)
method cancel(this, id, when)
It is a command to cancel/deactivate pending orders by referencing their names, which were generated by the functions: strategy.order, strategy.entry and strategy.exit.
Namespace types: bot
Parameters:
this (bot)
id (string) : (string) A required parameter. The order identifier. It is possible to cancel an order by referencing its identifier.
when (bool) : (bool) An optional parmeter. Condition, deprecated.
Returns: (void)
method cancel_all(this, when)
It is a command to cancel/deactivate all pending orders, which were generated by the functions: strategy.order, strategy.entry and strategy.exit.
Namespace types: bot
Parameters:
this (bot)
when (bool) : (bool) An optional parmeter. Condition, deprecated.
Returns: (void)
method close(this, id, comment, qty, qty_percent, alert_message, immediately, when)
It is a command to exit from the entry with the specified ID. If there were multiple entry orders with the same ID, all of them are exited at once. If there are no open entries with the specified ID by the moment the command is triggered, the command will not come into effect. The command uses market order. Every entry is closed by a separate market order.
Namespace types: bot
Parameters:
this (bot)
id (string) : (string) A required parameter. The order identifier. It is possible to close an order by referencing its identifier.
comment (string) : (string) An optional parameter. Additional notes on the order.
qty (float) : (float) An optional parameter. Number of contracts/shares/lots/units to exit a trade with. The default value is 'NaN'.
qty_percent (float) : (float) Defines the percentage (0-100) of the position to close. Its priority is lower than that of the 'qty' parameter. Optional. The default is 100.
alert_message (string) : (string) An optional parameter which replaces the {{strategy.order.alert_message}} placeholder when it is used in the "Create Alert" dialog box's "Message" field.
immediately (bool) : (bool) An optional parameter. If true, the closing order will be executed on the tick where it has been placed, ignoring the strategy parameters that restrict the order execution to the open of the next bar. The default is false.
when (bool) : (bool) An optional parmeter. Condition, deprecated.
Returns: (void)
ticks_to_price(ticks, from)
Converts ticks to a price offset from the supplied price or the average entry price.
Parameters:
ticks (float) : (float) Ticks to convert to a price.
from (float) : (float) A price that can be used to calculate from. Optional. The default value is `strategy.position_avg_price`.
Returns: (float) A price level that has a distance from the entry price equal to the specified number of ticks.
method exit(this, id, from_entry, qty, qty_percent, profit, limit, loss, stop, trail_price, trail_points, trail_offset, oca_name, comment, comment_profit, comment_loss, comment_trailing, alert_message, alert_profit, alert_loss, alert_trailing, when)
It is a command to exit either a specific entry, or whole market position. If an order with the same ID is already pending, it is possible to modify the order. If an entry order was not filled, but an exit order is generated, the exit order will wait till entry order is filled and then the exit order is placed. To deactivate an exit order, the command strategy.cancel or strategy.cancel_all should be used. If the function strategy.exit is called once, it exits a position only once. If you want to exit multiple times, the command strategy.exit should be called multiple times. If you use a stop loss and a trailing stop, their order type is 'stop', so only one of them is placed (the one that is supposed to be filled first). If all the following parameters 'profit', 'limit', 'loss', 'stop', 'trail_points', 'trail_offset' are 'NaN', the command will fail. To use market order to exit, the command strategy.close or strategy.close_all should be used.
Namespace types: bot
Parameters:
this (bot)
id (string) : (string) A required parameter. The order identifier. It is possible to cancel or modify an order by referencing its identifier.
from_entry (string) : (string) An optional parameter. The identifier of a specific entry order to exit from it. To exit all entries an empty string should be used. The default values is empty string.
qty (float) : (float) An optional parameter. Number of contracts/shares/lots/units to exit a trade with. The default value is 'NaN'.
qty_percent (float) : (float) Defines the percentage of (0-100) the position to close. Its priority is lower than that of the 'qty' parameter. Optional. The default is 100.
profit (float) : (float) An optional parameter. Profit target (specified in ticks). If it is specified, a limit order is placed to exit market position when the specified amount of profit (in ticks) is reached. The default value is 'NaN'.
limit (float) : (float) An optional parameter. Profit target (requires a specific price). If it is specified, a limit order is placed to exit market position at the specified price (or better). Priority of the parameter 'limit' is higher than priority of the parameter 'profit' ('limit' is used instead of 'profit', if its value is not 'NaN'). The default value is 'NaN'.
loss (float) : (float) An optional parameter. Stop loss (specified in ticks). If it is specified, a stop order is placed to exit market position when the specified amount of loss (in ticks) is reached. The default value is 'NaN'.
stop (float) : (float) An optional parameter. Stop loss (requires a specific price). If it is specified, a stop order is placed to exit market position at the specified price (or worse). Priority of the parameter 'stop' is higher than priority of the parameter 'loss' ('stop' is used instead of 'loss', if its value is not 'NaN'). The default value is 'NaN'.
trail_price (float) : (float) An optional parameter. Trailing stop activation level (requires a specific price). If it is specified, a trailing stop order will be placed when the specified price level is reached. The offset (in ticks) to determine initial price of the trailing stop order is specified in the 'trail_offset' parameter: X ticks lower than activation level to exit long position; X ticks higher than activation level to exit short position. The default value is 'NaN'.
trail_points (float) : (float) An optional parameter. Trailing stop activation level (profit specified in ticks). If it is specified, a trailing stop order will be placed when the calculated price level (specified amount of profit) is reached. The offset (in ticks) to determine initial price of the trailing stop order is specified in the 'trail_offset' parameter: X ticks lower than activation level to exit long position; X ticks higher than activation level to exit short position. The default value is 'NaN'.
trail_offset (float) : (float) An optional parameter. Trailing stop price (specified in ticks). The offset in ticks to determine initial price of the trailing stop order: X ticks lower than 'trail_price' or 'trail_points' to exit long position; X ticks higher than 'trail_price' or 'trail_points' to exit short position. The default value is 'NaN'.
oca_name (string) : (string) An optional parameter. Name of the OCA group (oca_type = strategy.oca.reduce) the profit target, the stop loss / the trailing stop orders belong to. If the name is not specified, it will be generated automatically.
comment (string) : (string) Additional notes on the order. If specified, displays near the order marker on the chart. Optional. The default is na.
comment_profit (string) : (string) Additional notes on the order if the exit was triggered by crossing `profit` or `limit` specifically. If specified, supercedes the `comment` parameter and displays near the order marker on the chart. Optional. The default is na.
comment_loss (string) : (string) Additional notes on the order if the exit was triggered by crossing `stop` or `loss` specifically. If specified, supercedes the `comment` parameter and displays near the order marker on the chart. Optional. The default is na.
comment_trailing (string) : (string) Additional notes on the order if the exit was triggered by crossing `trail_offset` specifically. If specified, supercedes the `comment` parameter and displays near the order marker on the chart. Optional. The default is na.
alert_message (string) : (string) Text that will replace the '{{strategy.order.alert_message}}' placeholder when one is used in the "Message" field of the "Create Alert" dialog. Optional. The default is na.
alert_profit (string) : (string) Text that will replace the '{{strategy.order.alert_message}}' placeholder when one is used in the "Message" field of the "Create Alert" dialog. Only replaces the text if the exit was triggered by crossing `profit` or `limit` specifically. Optional. The default is na.
alert_loss (string) : (string) Text that will replace the '{{strategy.order.alert_message}}' placeholder when one is used in the "Message" field of the "Create Alert" dialog. Only replaces the text if the exit was triggered by crossing `stop` or `loss` specifically. Optional. The default is na.
alert_trailing (string) : (string) Text that will replace the '{{strategy.order.alert_message}}' placeholder when one is used in the "Message" field of the "Create Alert" dialog. Only replaces the text if the exit was triggered by crossing `trail_offset` specifically. Optional. The default is na.
when (bool) : (bool) An optional parmeter. Condition, deprecated.
Returns: (void)
percent_to_ticks(percent, from)
Converts a percentage of the supplied price or the average entry price to ticks.
Parameters:
percent (float) : (float) The percentage of supplied price to convert to ticks. 50 is 50% of the entry price.
from (float) : (float) A price that can be used to calculate from. Optional. The default value is `strategy.position_avg_price`.
Returns: (float) A value in ticks.
percent_to_price(percent, from)
Converts a percentage of the supplied price or the average entry price to a price.
Parameters:
percent (float) : (float) The percentage of the supplied price to convert to price. 50 is 50% of the supplied price.
from (float) : (float) A price that can be used to calculate from. Optional. The default value is `strategy.position_avg_price`.
Returns: (float) A value in the symbol's quote currency (USD for BTCUSD).
bot
Fields:
password (series__string)
start_time (series__integer)
end_time (series__integer)
leverage (series__integer)
initial_capital (series__float)
default_qty_type (series__string)
default_qty_value (series__float)
margin_mode (series__string)
contract_size (series__float)
kis_number (series__integer)
entry_percent (series__float)
close_percent (series__float)
exit_percent (series__float)
log_table (series__table)
fixed_qty (series__float)
fixed_cash (series__float)
real (series__bool)
auto_alert_message (series__bool)
hide_trade_line (series__bool)
HYE Combo Market [Strategy] (Vwap Mean Reversion + Trend Hunter)In this strategy, I used a combination of trend hunter and vwap mean reversion strategies that I published before.
Trend Hunter Strategy:
Mean Reversion Vwap Strategy:
The results are quite impressive, especially for bitcoin.
While the hodl return for bitcoin was 13419%, the strategy's return in the same period was about 5 times (65000%) of this.
s3.tradingview.com
In this combo strategy, I made some changes to the original settings of the strategies used together and added some more new features.
Trend Hunter Strategy Settings: (Original / Combo)
- Slow Tenkansen Period : 9 / 9
- Slow Kijunsen Period : 26 / 13
- Fast Tenkansen Period : 5 / 3
- Fast Kijunsen Period : 13 / 7
- BB Length : 20 / 20
- BB Stdev : 2 / 2
- TSV Length : 13 / 20
- TSV Ema Length : 7 / 7
* I also added a "vidya moving average" to be used as a confirmation tool to open a long position. (Candle close must be above the vidya line.)
Vwap Mean Reversion Strategy Settings: (Original / Combo)
- Small Vwap : 2 / 8
- Big Vwap : 5 / 10
- Percent Below to Buy : 3 / 2
- RSI Period : 2 / 2
- RSI Ema Period : 5 / 5
- Maximum RSI Level for Buy : 30
* I also added a "mean vwap line" to be used for exits in this part of the strategy. In the original version, when small vwap crossovers big vwap, we close the position, but in this strategy we will wait for the close above the mean vwap.
TIPS AND WARNINGS
1-) The standard settings of this combo strategy is designed and tested with daily timeframe. For lower timeframes, you should change the strategy settings and find the best value for yourself.
2-) Only the mean vwap line is displayed on the graph. For a detailed view, you can delete the "//" marks from the plot codes in the strategy code.
3-) This is a strategy for educational and experimental purposes. It cannot be considered as investment advice. You should be careful and make your own risk assessment when opening real market trades using this strategy.
________________________________________________________
Bu stratejide, daha önce yayınladığım trend avcısı ve vwap ortalamaya geri dönüş stratejilerinin bir kombinasyonunu kullandım.
Sonuçlar özellikle bitcoin için oldukça etkileyici.
Bitcoin için hodl getirisi %13419 iken, stratejinin aynı dönemdeki getirisi bunun yaklaşık 5 katı (%65000) idi.
Bu kombo stratejide, birlikte kullanılan stratejilerin orijinal ayarlarında bazı değişiklikler yaptım ve bazı yeni özellikler ekledim.
Trend Avcısı Strateji Ayarları: (Orijinal / Combo)
- Yavaş Tenkansen Periyodu : 9 / 9
- Yavaş Kijunsen Periyodu : 26 / 13
- Hızlı Tenkansen Periyodu : 5 / 3
- Hızlı Kijunsen Periyodu : 13 / 7
- BB Uzunluğu : 20 / 20
- BB Standart Sapması : 2 / 2
- TSV Uzunluğu : 13 / 20
- TSV Ema Uzunluğu : 7 / 7
* Ayrıca long pozisyon açmak için onay aracı olarak kullanılmak üzere "vidya hareketli ortalama" ekledim. (Mum kapanışı vidya çizgisinin üzerinde olmalıdır.)
Vwap Ortalamaya Dönüş Stratejisi Ayarları: (Orijinal / Combo)
- Küçük Vwap : 2 / 8
- Büyük Vwap : 5 / 10
- Alış İçin Gerekli Fark Oranı : 3 / 2
- RSI Periyodu : 2 / 2
- RSI Ema Periyodu: 5 / 5
- Alış için gerekli maksimum RSI seviyesi : 30
* Stratejinin bu bölümünde pozisyondan çıkışlar için kullanılacak bir "ortalama vwap çizgisi" de ekledim. Orijinal versiyonda, küçük vwap, büyük vwap'ı yukarı kestiğinde pozisyonu kapatıyoruz, ancak bu stratejide, ortalama vwap'ın üzerindeki kapanışı bekleyeceğiz.
İPUÇLARI VE UYARILAR
1-) Bu birleşik stratejinin standart ayarları, günlük zaman dilimi ile tasarlanmış ve test edilmiştir. Daha düşük zaman dilimleri için strateji ayarlarını değiştirmeli ve kendiniz için en iyi değeri bulmalısınız.
2-) Grafikte sadece ortalama vwap çizgisi görüntülenir. Ayrıntılı bir görünüm için strateji kodundaki "plot" ile başlayan satırlarda grafikte görünmesini istediğiniz özelliğin önündeki "//" işaretlerini silebilirsiniz.
3-) Eğitim ve deneysel amaçlı bir stratejidir. Yatırım tavsiyesi olarak değerlendirilemez. Bu stratejiyi kullanarak gerçek piyasa işlem açarken dikkatli olmalı ve kendi risk değerlendirmenizi yapmalısınız.
Systematic Investment Tracker by Ceyhun Gonul### English Description
**Systematic Investment Tracker with Enhanced Features**
This script, titled **Systematic Investment Tracker with Enhanced Features**, is a TradingView tool designed to support systematic investments across different market conditions. It provides traders with two customizable investment strategies — **Continuous Buying** and **Declining Buying** — and includes advanced dynamic investment adjustment features for each.
#### Detailed Explanation of Script Features and Originality
1. **Two Investment Strategies**:
- **Continuous Buying**: This strategy performs purchases consistently at each interval, as set by the user, regardless of market price changes. It follows the principle of dollar-cost averaging, allowing users to build an investment position over time.
- **Declining Buying**: Unlike Continuous Buying, this strategy triggers purchases only when the asset's price has declined from the previous interval's closing price. This approach helps users capitalize on lower price points, potentially improving average costs during downward trends.
2. **Dynamic Investment Adjustment**:
- For both strategies, the script includes a **Dynamic Investment Adjustment** feature. If enabled, this feature increases the purchasing amount by 50% if the current price has fallen by a specific user-defined percentage relative to the previous price. This allows users to accumulate a larger position when the asset is declining, which may benefit long-term cost-averaging strategies.
3. **Customizable Time Frames**:
- Users can specify a **start and end date** for investment, allowing them to restrict or backtest strategies within a specific timeframe. This feature is valuable for evaluating strategy performance over specific market cycles or historical periods.
4. **Graphical Indicators and Labels**:
- The script provides graphical labels on the chart that display purchase points. These indicators help users visualize their investment entries based on the strategy selected.
- A summary **performance label** is also displayed, providing real-time updates on the total amount spent, accumulated quantity, average cost, portfolio value, and profit percentage for each strategy.
5. **Language Support**:
- The script includes English and Turkish language options. Users can toggle between these languages, allowing the summary label text and descriptions to be displayed in their preferred language.
6. **Performance Comparison Table**:
- An optional **Performance Comparison Table** is available, offering a side-by-side analysis of net profit, total investment, and profit percentage for both strategies. This comparison table helps users assess which strategy has yielded better returns, providing clarity on each approach's effectiveness under the chosen parameters.
#### How the Script Works and Its Uniqueness
This closed-source script brings together two established investment strategies in a single, dynamic tool. By integrating continuous and declining purchase strategies with advanced settings for dynamic investment adjustment, the script offers a powerful, flexible tool for both passive and active investors. The design of this script provides unique benefits:
- Enables automated, systematic investment tracking, allowing users to build positions gradually.
- Empowers users to leverage declines through dynamic adjustments to optimize average cost over time.
- Presents an easy-to-read performance label and table, enabling an efficient and transparent performance comparison for informed decision-making.
---
### Türkçe Açıklama
**Gelişmiş Özellikli Sistematik Yatırım Takipçisi**
**Gelişmiş Özellikli Sistematik Yatırım Takipçisi** adlı bu TradingView scripti, çeşitli piyasa koşullarında sistematik yatırım stratejilerini desteklemek üzere tasarlanmış bir araçtır. Script, kullanıcıya iki özelleştirilebilir yatırım stratejisi — **Sürekli Alım** ve **Düşen Alım** — ve her strateji için gelişmiş dinamik yatırım ayarlama seçenekleri sunar.
#### Script Özelliklerinin Detaylı Açıklaması ve Özgünlük
1. **İki Yatırım Stratejisi**:
- **Sürekli Alım**: Bu strateji, fiyat değişimlerine bakılmaksızın kullanıcının belirlediği her aralıkta sabit bir miktar yatırım yapar. Bu yaklaşım, uzun vadede pozisyonu kademeli olarak oluşturmak isteyenler için idealdir.
- **Düşen Alım**: Sürekli Alım’ın aksine, bu strateji yalnızca fiyat bir önceki aralığın kapanış fiyatına göre düştüğünde alım yapar. Bu yöntem, yatırımcıların daha düşük fiyatlardan alım yaparak ortalama maliyeti potansiyel olarak iyileştirmelerine yardımcı olur.
2. **Dinamik Yatırım Ayarlaması**:
- Her iki strateji için de **Dinamik Yatırım Ayarlaması** özelliği bulunmaktadır. Bu özellik aktif edildiğinde, mevcut fiyatın bir önceki fiyata göre kullanıcı tarafından belirlenen bir yüzde oranında düşmesi durumunda alım miktarını %50 artırır. Bu durum, uzun vadede maliyet ortalaması stratejilerine katkıda bulunur.
3. **Özelleştirilebilir Tarih Aralığı**:
- Kullanıcılar, yatırımı belirli bir tarih aralığında sınırlandırmak veya test etmek için bir **başlangıç ve bitiş tarihi** belirleyebilir. Bu özellik, strateji performansını geçmiş piyasa döngüleri veya belirli dönemlerde değerlendirmek için kullanışlıdır.
4. **Grafiksel İşaretleyiciler ve Etiketler**:
- Script, grafik üzerinde alım noktalarını gösteren işaretleyiciler sağlar. Bu görsel göstergeler, kullanıcıların seçilen stratejiye göre yatırım girişlerini görselleştirmesine yardımcı olur.
- Ayrıca, her strateji için harcanan toplam tutar, biriken miktar, ortalama maliyet, portföy değeri ve kâr yüzdesi gibi bilgileri gerçek zamanlı olarak gösteren bir **performans etiketi** sunar.
5. **Dil Desteği**:
- Script, İngilizce ve Türkçe dillerini desteklemektedir. Kullanıcılar, performans etiketi metninin ve açıklamalarının tercih ettikleri dilde görüntülenmesi için dil seçimini yapabilir.
6. **Performans Karşılaştırma Tablosu**:
- İsteğe bağlı olarak kullanılabilen bir **Performans Karşılaştırma Tablosu**, her iki strateji için net kâr, toplam yatırım ve kâr yüzdesi gibi bilgileri yan yana analiz eder. Bu tablo, kullanıcıların hangi stratejinin daha yüksek getiri sağladığını değerlendirmesine yardımcı olur.
#### Scriptin Çalışma Prensibi ve Özgünlüğü
Bu script, iki yatırım stratejisini gelişmiş bir araçta birleştirir. Sürekli ve düşen fiyatlara dayalı alım stratejilerini dinamik yatırım ayarlama özelliğiyle entegre ederek yatırımcılar için güçlü ve esnek bir çözüm sunar. Script’in tasarımı aşağıdaki benzersiz faydaları sağlamaktadır:
- Otomatik, sistematik yatırım takibi yaparak kullanıcıların pozisyonlarını kademeli olarak oluşturmalarına olanak tanır.
- Dinamik ayarlama ile düşüşlerden yararlanarak zaman içinde ortalama maliyeti optimize etme olanağı sağlar.
- Her iki stratejinin performansını basit ve anlaşılır bir şekilde karşılaştıran etiket ve tablo ile verimli bir performans değerlendirmesi sunar.
Commodity Channel Index CCI + EMA strategy
================================================================================
COMMODITY CHANNEL INDEX CCI + EMA STRATEGY - STRATEGY GUIDE 📊
================================================================================
💡 COLLABORATION & SUPPORT
---------------------------
If you want to collaborate, have an idea for a strategy, or need help writing
or customizing code, send an email to burdytrader@gmail.com or send me a
message. Suggestions, ideas, and comments are always welcome! 🤝
I also develop automated trading codes for other trading platforms including:
- CTrader (C#)
- MetaTrader 4 (MQL4)
- MetaTrader 5 (MQL5)
If you need a strategy converted or developed for any of these platforms, feel
free to contact me!
================================================================================
⚠️ IMPORTANT: INSTRUMENT SELECTION 📈
-------------------------------------
This strategy performs BEST with currency pairs (forex). The CCI indicator
works particularly well in the forex market due to the nature of currency
movements and the effectiveness of the CCI in identifying overbought and
oversold conditions in trending markets.
Why Currency Pairs? 🎯
- CCI is highly effective in identifying reversals in forex markets
- Currency pairs show clear overbought/oversold patterns
- EMA filter (50/200) aligns well with major forex trends
- High liquidity ensures reliable signal execution
Performance Highlights:
In specific currency pairs, when properly configured, this strategy can achieve:
- Profit Factor: Over 2.0
- Win Rate: Up to 70%
- Particularly effective pairs: USDCAD, EURUSD, GBPJPY
While the strategy can work with other instruments (stocks, indices, commodities),
currency pairs provide the most consistent and reliable results. For optimal
performance, focus on major forex pairs with good liquidity and clear trending
characteristics.
================================================================================
WHAT DOES THIS STRATEGY DO? 🎯
---------------------------
This strategy combines the Commodity Channel Index (CCI) with Exponential
Moving Averages (EMA) to identify high-probability trading opportunities.
The strategy uses CCI crossovers with a smoothing moving average and filters
signals using EMA trend confirmation. The strategy automatically enters trades
when CCI crosses the smoothing MA in specific zones, indicating potential trend
reversals or continuations.
HOW IT WORKS? ⚙️
---------------
1. CCI CALCULATION 📈
The strategy calculates the Commodity Channel Index using:
- CCI = (Price - SMA(Price, length)) / (0.015 × Deviation(Price, length))
- Default length: 20 periods
- Source: HLC3 (typical price)
The CCI shows:
- Values above +100 = Overbought conditions
- Values below -100 = Oversold conditions
- Values around 0 = Neutral conditions
2. SMOOTHING MOVING AVERAGE 📊
A moving average is applied to the CCI to smooth out fluctuations:
- Types available: SMA, EMA, SMMA (RMA), WMA, VWMA
- Default: SMA with length 14
- Can be disabled (set to "None")
This smoothed line acts as a reference for crossover signals.
3. EMA TREND FILTER 🎯
Two EMAs are calculated on the CCI:
- EMA 50 (fast EMA)
- EMA 200 (slow EMA)
When the EMA filter is enabled:
- LONG signals only occur when EMA50 > EMA200 (uptrend confirmation)
- SHORT signals only occur when EMA50 < EMA200 (downtrend confirmation)
This filter can be enabled/disabled via the "Use EMA Filter" option.
4. ENTRY CONDITIONS 🎲
LONG ENTRY (Buy Signal):
- CCI crosses ABOVE the Smoothing MA (crossover)
- CCI is between Lower Level (-100) and Middle Level (0)
- EMA Filter: EMA50 > EMA200 (if filter enabled)
- No existing positions (or close opposite positions first)
SHORT ENTRY (Sell Signal):
- CCI crosses BELOW the Smoothing MA (crossunder)
- CCI is between Middle Level (0) and Upper Level (+100)
- EMA Filter: EMA50 < EMA200 (if filter enabled)
- No existing positions (or close opposite positions first)
5. POSITION MANAGEMENT 💰
The strategy uses a simple position management approach:
- Only ONE position at a time (no pyramiding)
- If a signal occurs in the opposite direction, closes existing position first
- Then opens new position in the new direction
- This prevents overexposure and simplifies risk management
6. TAKE PROFIT & STOP LOSS SETTINGS 🎯
The strategy uses percentage-based TP/SL:
- Take Profit: 1.0% (default, configurable)
- Stop Loss: 0.5% (default, configurable)
- Risk/Reward Ratio: 2:1 (TP is double the SL)
TP/SL are calculated once when the position opens and remain fixed.
AVAILABLE PARAMETERS ⚙️
-----------------------
CCI SETTINGS:
1. CCI Length (Default: 20)
- Period for CCI calculation
- Lower values = More sensitive to recent price action
- Higher values = More smoothed, less sensitive
2. CCI Source (Default: HLC3)
- Price source for CCI calculation
- Options: close, open, high, low, hlc3, hlcc4, ohlc4
3. CCI Lower Level (Default: -100)
- Lower boundary for LONG entry zone
- Typically -100 for oversold conditions
4. CCI Middle Level (Default: 0)
- Neutral level separating LONG and SHORT zones
5. CCI Upper Level (Default: +100)
- Upper boundary for SHORT entry zone
- Typically +100 for overbought conditions
SMOOTHING MA:
6. Type (Default: SMA)
- Moving average type: None, SMA, EMA, SMMA (RMA), WMA, VWMA
- Set to "None" to disable smoothing
7. Length (Default: 14)
- Period for smoothing MA
- Range: 7-28, step 7
EMA FILTER:
8. EMA 1 Length (Default: 50)
- Fast EMA period applied to CCI
9. EMA 2 Length (Default: 200)
- Slow EMA period applied to CCI
10. Use EMA Filter (Default: true)
- Enable/disable EMA trend filter
- When enabled: LONG only if EMA50 > EMA200, SHORT only if EMA50 < EMA200
RISK MANAGEMENT:
11. Take Profit (%) (Default: 1.0%)
- Profit target as percentage of entry price
- For LONG: Entry × (1 + TP%)
- For SHORT: Entry × (1 - TP%)
12. Stop Loss (%) (Default: 0.5%)
- Stop loss as percentage of entry price
- For LONG: Entry × (1 - SL%)
- For SHORT: Entry × (1 + SL%)
VISUALIZATION 📊
---------------
The strategy displays in a separate panel below the price chart:
1. CCI LINE
- Blue line showing the CCI value
- Oscillates around zero
2. SMOOTHING MA LINE
- Yellow line showing the smoothed CCI
- Reference line for crossover signals
3. CCI LEVEL LINES
- Red dashed line: Upper Level (+100)
- Green dashed line: Lower Level (-100)
- Yellow dashed line: Middle Level (0)
4. ENTRY SIGNALS
- Green cross: LONG entry signal (when CCI crosses above MA)
- Red cross: SHORT entry signal (when CCI crosses below MA)
RECOMMENDED SETTINGS 🎯
-----------------------
To get started, you can use these settings:
CCI SETTINGS:
- CCI Length: 20 (default)
- CCI Source: HLC3 (default)
- CCI Lower Level: -100 (default)
- CCI Middle Level: 0 (default)
- CCI Upper Level: +100 (default)
SMOOTHING MA:
- Type: SMA (default) or EMA for faster response
- Length: 14 (default)
EMA FILTER:
- EMA 1 Length: 50 (default)
- EMA 2 Length: 200 (default)
- Use EMA Filter: true (recommended for better signal quality)
RISK MANAGEMENT:
- Take Profit (%): 1.0% (adjust based on your risk/reward preference)
- Stop Loss (%): 0.5% (adjust based on your risk tolerance)
For more aggressive trading:
- Reduce CCI Length to 14-16
- Reduce Smoothing MA Length to 7
- Disable EMA Filter
For more conservative trading:
- Increase CCI Length to 24-30
- Increase Smoothing MA Length to 21-28
- Keep EMA Filter enabled
RECOMMENDED CURRENCY PAIRS 💱
------------------------------
This strategy is optimized for currency pairs and performs exceptionally well
on the following pairs when properly configured:
TOP PERFORMING PAIRS:
- USDCAD: Can achieve Profit Factor > 2.0 and Win Rate up to 70%
- EURUSD: Excellent performance with consistent signals
- GBPJPY: Strong results with proper EMA filter configuration
These pairs have shown the best historical performance due to:
- Clear trending characteristics
- Good response to CCI overbought/oversold levels
- Strong alignment with EMA 50/200 trend filter
- High liquidity ensuring reliable execution
When trading these pairs, use the default settings or slightly adjusted
parameters based on the pair's volatility. Always backtest on historical
data before using real money to find the optimal configuration for each
specific pair.
PRACTICAL EXAMPLE 📝
--------------------
Scenario: LONG Entry on EUR/USD
1. Market conditions:
- Price: 1.1000
- CCI: -80 (in oversold zone)
- Smoothing MA: -90
- CCI crosses above Smoothing MA (crossover occurs)
- EMA50: -50, EMA200: -70 (EMA50 > EMA200, uptrend confirmed)
2. Strategy checks conditions:
✓ Smoothing MA enabled: Yes
✓ Crossover: Yes (CCI crosses above MA)
✓ CCI in range: Yes (-100 <= -80 <= 0)
✓ EMA Filter: Yes (EMA50 > EMA200)
✓ No existing position: Yes
3. Strategy opens position:
- Direction: LONG (Buy)
- Entry: 1.1000 (current close)
- Take Profit: 1.1110 (1.0% above entry)
- Stop Loss: 1.0945 (0.5% below entry)
- Risk/Reward: 2:1
4. Outcome scenarios:
- If price rises to 1.1110 → Take Profit hit (profit)
- If price falls to 1.0945 → Stop Loss hit (loss limited)
IMPORTANT NOTE ⚠️
-----------------
This strategy is a technical analysis tool based on CCI and EMA indicators.
Like all trading strategies, it does NOT guarantee profits. Trading involves
significant risks and you can lose money, including your entire investment.
Past performance does not guarantee future results.
Always:
- Use appropriate risk management
- Never risk more than you can afford to lose
- Test the strategy on historical data (backtesting) before using real money
- Start with small position sizes or paper trading
- Understand that no strategy works 100% of the time
- Consider market conditions, news events, and other factors
- Keep a trading journal to learn and improve
The author and contributors are NOT responsible for any losses incurred from
using this strategy. Trading decisions are your own responsibility. Profits
are NOT guaranteed, and losses are possible.
LICENSE 📄
----------
This code is open source and available for modification. You are free to use,
modify, and distribute this strategy. If you republish or share a modified
version, please kindly mention the original author.
================================================================================
Delta Volume EMA Strategy
================================================================================
DELTA VOLUME EMA STRATEGY - STRATEGY GUIDE 📊
================================================================================
💡 COLLABORATION & SUPPORT
---------------------------
If you want to collaborate, have an idea for a strategy, or need help writing
or customizing code, send an email to burdytrader@gmail.com or send me a
message. Suggestions, ideas, and comments are always welcome! 🤝
================================================================================
⚠️ IMPORTANT: INSTRUMENT SELECTION 📈
-------------------------------------
This strategy performs BEST with instruments that have a centralized data flow,
such as Futures contracts. Centralized markets provide more accurate and
reliable volume data, which is essential for Volume Delta analysis to work
effectively.
Why Futures? 🎯
- Centralized exchange = Accurate volume data
- All trades flow through a single exchange
- Volume reflects true buying/selling pressure
- Better correlation between volume and price movements
While the strategy can work with other instruments (stocks, forex, etc.),
volume data quality may vary, which can affect the reliability of Volume Delta
signals. For optimal performance, use Futures contracts or other instruments
with centralized, high-quality volume data.
================================================================================
WHAT DOES THIS STRATEGY DO? 🎯
---------------------------
This strategy uses Volume Delta analysis combined with Exponential Moving
Averages (EMA) to identify high-probability trading opportunities. The Volume
Delta measures the difference between buying and selling pressure, helping to
identify when strong institutional or smart money movements occur. The strategy
automatically enters trades when volume delta reaches extreme levels, indicating
potential trend continuation or reversal points.
HOW IT WORKS? ⚙️
---------------
1. VOLUME DELTA CALCULATION 📈
The strategy calculates the Volume Delta using the following formula:
- Volume Ratio (v) = Current Volume / Previous Volume
- EMA of Close (mac) = EMA(Close, MA Length) × Volume Ratio
- EMA of Open (mao) = EMA(Open, MA Length) × Volume Ratio
- Volume Delta (vd) = mac - mao
The Volume Delta shows:
- Positive values (green) = Buying pressure (buyers are more active)
- Negative values (red) = Selling pressure (sellers are more active)
2. VOLUME DELTA MOVING AVERAGE 📊
The strategy calculates an EMA of the Volume Delta (vdma) to smooth out
fluctuations and identify the overall trend of buying/selling pressure:
- vdma = EMA(Volume Delta, EMA Length)
- When vdma is above zero = Overall buying pressure
- When vdma is below zero = Overall selling pressure
3. PERCENTILE-BASED ENTRY CONDITIONS 🎲
Instead of using fixed thresholds, the strategy uses percentile analysis to
identify extreme volume delta movements:
For LONG entries:
- Analyzes seller volumes (negative volume delta) over the lookback period
- Calculates the percentile threshold (default: 80th percentile)
- Enters LONG when volume delta becomes positive AND exceeds the threshold
- This indicates a strong shift from selling to buying pressure
For SHORT entries:
- Analyzes buyer volumes (positive volume delta) over the lookback period
- Calculates the percentile threshold (default: 80th percentile)
- Enters SHORT when volume delta becomes negative AND exceeds the threshold
- This indicates a strong shift from buying to selling pressure
4. POSITION SIZING 💰
The strategy offers two position sizing methods:
a) RISK VALUE (Fixed Risk in Dollars):
- Calculates position size based on a fixed dollar risk amount
- Formula: Position Size = Risk Amount / (Entry Price × Stop Loss %)
- Ensures consistent risk per trade regardless of price level
b) LOTS SIZE:
- Uses a fixed lot size for all trades
- Simple and straightforward approach
- Useful when you want consistent position sizes
5. TAKE PROFIT & STOP LOSS SETTINGS 🎯
The strategy offers flexible TP/SL configuration in three modes:
a) PERCENTAGE (%):
- TP/SL calculated as a percentage of entry price
- Example: 2% TP means entry price × 1.02 (for LONG) or × 0.98 (for SHORT)
- Adapts automatically to different price levels
b) CURRENCY:
- TP/SL set as a fixed currency amount
- Example: $100 TP means entry price + $100 (for LONG) or - $100 (for SHORT)
- Useful for instruments with consistent price movements
c) PIPS:
- TP/SL set as a fixed number of pips
- Automatically converts pips to price using the instrument's minimum tick
- Ideal for forex and other pip-based instruments
6. AUTOMATIC TRADE EXECUTION ⚡
When entry conditions are met:
- Opens a position (LONG or SHORT) at market price
- Automatically sets Take Profit and Stop Loss based on selected mode
- Sends an alert with all trade information
- Only one position at a time (waits for current position to close)
AVAILABLE PARAMETERS ⚙️
----------------------
1. MA LENGTH (Default: 10)
- Length of the Exponential Moving Average used for close and open prices
- Lower values = More sensitive to recent price action
- Higher values = More smoothed, less sensitive
2. EMA LENGTH (Default: 20)
- Length of the EMA applied to Volume Delta
- Controls the smoothing of the volume delta signal
- Lower values = Faster signals, more trades
- Higher values = Slower signals, fewer but potentially more reliable trades
3. POSITION SIZE MODE
- "Risk Value": Calculate position size based on fixed dollar risk
- "Lots Size": Use fixed lot size for all trades
4. FIXED RISK IN $ (Default: 50)
- Only used when Position Size Mode = "Risk Value"
- The dollar amount you're willing to risk per trade
- Strategy calculates position size automatically
5. LOT SIZE (Default: 0.01)
- Only used when Position Size Mode = "Lots Size"
- Fixed lot size for all trades
6. TAKE PROFIT MODE
- "%": Percentage of entry price
- "Currency": Fixed currency amount
- "Pips": Fixed number of pips
7. STOP LOSS MODE
- "%": Percentage of entry price
- "Currency": Fixed currency amount
- "Pips": Fixed number of pips
8. TAKE PROFIT / STOP LOSS VALUES
- Different input fields appear based on selected mode
- Configure TP and SL independently
9. VOLUME LOOKBACK PERIOD (Default: 20)
- Number of bars used to calculate percentile thresholds
- Lower values = More sensitive, adapts faster to recent conditions
- Higher values = More stable, uses longer-term statistics
10. PERCENTILE THRESHOLD (Default: 80%)
- The percentile level used to identify extreme volume delta movements
- 80% means: only enter when volume delta exceeds 80% of recent values
- Higher values = Fewer but potentially stronger signals
- Lower values = More frequent signals
VISUALIZATION 📊
---------------
The strategy displays on the chart:
1. VOLUME DELTA COLUMNS
- Green columns = Positive volume delta (buying pressure)
- Red columns = Negative volume delta (selling pressure)
- Height represents the magnitude of buying/selling pressure
2. VOLUME DELTA MA AREA
- Two overlapping area plots showing the smoothed volume delta
- Black area (base layer) for overall visualization
- Green area (when positive) = Overall buying pressure trend
- Red area (when negative) = Overall selling pressure trend
- Helps identify the dominant market sentiment
3. ZERO LINE
- Horizontal line at zero
- Helps visualize when buying/selling pressure crosses the neutral point
ALERTS 🔔
--------
When enabled, the strategy sends alerts when a trade is opened. The alert
message includes:
- Direction: "Buy" for LONG positions or "Sell" for SHORT positions
- Entry Price: The price at which the position was opened
- TP (Take Profit): The target profit price
- SL (Stop Loss): The stop loss price
Example alert message:
"Buy | Entry: 1.2050 | TP: 1.2250 | SL: 1.1950"
Alerts can be configured in TradingView to send notifications via email,
SMS, webhooks, or other platforms.
RECOMMENDED SETTINGS 🎯
-----------------------
To get started, you can use these settings:
STRATEGY PARAMETERS:
- MA Length: 10 (default)
- EMA Length: 20 (default)
- Volume Lookback Period: 20 (default)
- Percentile Threshold: 80% (default)
POSITION SIZING:
- Position Size Mode: "Risk Value" (for risk management)
- Fixed Risk in $: Adjust based on your account size (e.g., 1-2% of account)
- OR use "Lots Size" with 0.01 lots for small accounts
TAKE PROFIT & STOP LOSS:
- TP Mode: "%" (recommended for most instruments)
- SL Mode: "%" (recommended for most instruments)
- Take Profit (%): 2.0% (adjust based on your risk/reward preference)
- Stop Loss (%): 1.0% (adjust based on your risk tolerance)
For Forex:
- Consider using "Pips" mode for TP/SL
- Typical values: 20-50 pips TP, 10-30 pips SL
For Stocks/Indices:
- Use "%" mode for TP/SL
- Typical values: 2-5% TP, 1-2% SL
PRACTICAL EXAMPLE 📝
-------------------
Scenario: LONG Entry on EUR/USD
1. Market conditions:
- Price: 1.1000
- Volume Delta becomes strongly positive
- Volume Delta exceeds 80th percentile of recent seller volumes
2. Strategy calculates:
- Entry Price: 1.1000 (current close)
- Position Size Mode: "Risk Value"
- Fixed Risk: $50
- Stop Loss Mode: "%"
- Stop Loss: 1.0%
- Position Size = $50 / (1.1000 × 0.01) = 4.55 lots
3. Strategy opens position:
- Direction: LONG (Buy)
- Entry: 1.1000
- Take Profit: 1.1220 (2% above entry)
- Stop Loss: 1.0890 (1% below entry)
- Alert sent: "Buy | Entry: 1.1000 | TP: 1.1220 | SL: 1.0890"
4. Outcome scenarios:
- If price rises to 1.1220 → Take Profit hit (profit)
- If price falls to 1.0890 → Stop Loss hit (loss limited to $50)
IMPORTANT NOTE ⚠️
-----------------
This strategy is a technical analysis tool based on volume delta analysis.
Like all trading strategies, it does NOT guarantee profits. Trading involves
significant risks and you can lose money, including your entire investment.
Past performance does not guarantee future results.
Always:
- Use appropriate risk management
- Never risk more than you can afford to lose
- Test the strategy on historical data (backtesting) before using real money
- Start with small position sizes or paper trading
- Understand that no strategy works 100% of the time
- Consider market conditions, news events, and other factors
- Keep a trading journal to learn and improve
The author and contributors are NOT responsible for any losses incurred from
using this strategy. Trading decisions are your own responsibility. Profits
are NOT guaranteed, and losses are possible.
LICENSE 📄
---------
This code is open source and available for modification. You are free to use,
modify, and distribute this strategy. If you republish or share a modified
version, please kindly mention the original author.
================================================================================






















